<script setup>
import { ref } from 'vue'
const companyList = ref([
  {
    name: '比亚迪汽车工业',
    logo: 'https://c-res.zhipin.com/jrs/d15aac097868c7c18d6bca11c6632e49.jpg?x-oss-process=image/resize,w_100,limit_0',
    finance: '已上市',
    scale: '10000人以上',
    industry: '汽车制造',
    jobList: [
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      }
    ]
  },
  {
    name: '比亚迪汽车工业',
    logo: 'https://c-res.zhipin.com/jrs/d15aac097868c7c18d6bca11c6632e49.jpg?x-oss-process=image/resize,w_100,limit_0',
    finance: '已上市',
    scale: '10000人以上',
    industry: '汽车制造',
    jobList: [
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      }
    ]
  },
  {
    name: '比亚迪汽车工业',
    logo: 'https://c-res.zhipin.com/jrs/d15aac097868c7c18d6bca11c6632e49.jpg?x-oss-process=image/resize,w_100,limit_0',
    finance: '已上市',
    scale: '10000人以上',
    industry: '汽车制造',
    jobList: [
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      }
    ]
  },
  {
    name: '比亚迪汽车工业',
    logo: 'https://c-res.zhipin.com/jrs/d15aac097868c7c18d6bca11c6632e49.jpg?x-oss-process=image/resize,w_100,limit_0',
    finance: '已上市',
    scale: '10000人以上',
    industry: '汽车制造',
    jobList: [
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      }
    ]
  },
  {
    name: '比亚迪汽车工业',
    logo: 'https://c-res.zhipin.com/jrs/d15aac097868c7c18d6bca11c6632e49.jpg?x-oss-process=image/resize,w_100,limit_0',
    finance: '已上市',
    scale: '10000人以上',
    industry: '汽车制造',
    jobList: [
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      }
    ]
  },
  {
    name: '比亚迪汽车工业',
    logo: 'https://c-res.zhipin.com/jrs/d15aac097868c7c18d6bca11c6632e49.jpg?x-oss-process=image/resize,w_100,limit_0',
    finance: '已上市',
    scale: '10000人以上',
    industry: '汽车制造',
    jobList: [
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      }
    ]
  },
  {
    name: '比亚迪汽车工业',
    logo: 'https://c-res.zhipin.com/jrs/d15aac097868c7c18d6bca11c6632e49.jpg?x-oss-process=image/resize,w_100,limit_0',
    finance: '已上市',
    scale: '10000人以上',
    industry: '汽车制造',
    jobList: [
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      }
    ]
  },
  {
    name: '比亚迪汽车工业',
    logo: 'https://c-res.zhipin.com/jrs/d15aac097868c7c18d6bca11c6632e49.jpg?x-oss-process=image/resize,w_100,limit_0',
    finance: '已上市',
    scale: '10000人以上',
    industry: '汽车制造',
    jobList: [
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      }
    ]
  },
  {
    name: '比亚迪汽车工业',
    logo: 'https://c-res.zhipin.com/jrs/d15aac097868c7c18d6bca11c6632e49.jpg?x-oss-process=image/resize,w_100,limit_0',
    finance: '已上市',
    scale: '10000人以上',
    industry: '汽车制造',
    jobList: [
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      },
      {
        name: '比亚迪汽车工业招聘电工',
        salary: '6k-9k',
        address: '东莞',
        experience: '1-3年',
        education: '高中'
      }
    ]
  }
])
</script>
<template>
  <section class="section bg-gray">
    <div class="container">
      <header class="header text-center">热门企业</header>

      <main class="enterprisepart-main mt-24">
        <div class="grid grid-9">
          <div
            class="enterprise-item-box"
            v-for="item in companyList"
            :key="item.index"
          >
            <a href="" class="enterprise-item">
              <div class="company-logo">
                <img :src="item.logo" alt="" />
              </div>
              <div class="company-info">
                <h3>{{ item.name }}</h3>
                <p>
                  {{ item.finance }}
                  <span class="vline"></span>
                  {{ item.scale }}
                  <span class="vline"></span>
                  {{ item.industry }}
                </p>
              </div>
            </a>

            <ul class="company-job-list">
              <li class="company-job-item">
                <a href="" class="job-info">
                  <div class="job-info-top">
                    <p class="name">{{ item.jobList[0].name }}</p>
                    <p class="salary">{{ item.jobList[0].salary }}</p>
                  </div>
                  <p class="job-tag">
                    <span>{{ item.jobList[0].address }}</span>
                    <span>{{ item.jobList[0].experience }}</span>
                    <span>{{ item.jobList[0].education }}</span>
                  </p>
                </a>
              </li>

              <li class="company-job-item">
                <a href="" class="job-info">
                  <div class="job-info-top">
                    <p class="name">{{ item.jobList[0].name }}</p>
                    <p class="salary">{{ item.jobList[0].salary }}</p>
                  </div>
                  <p class="job-tag">
                    <span>{{ item.jobList[0].address }}</span>
                    <span>{{ item.jobList[0].experience }}</span>
                    <span>{{ item.jobList[0].education }}</span>
                  </p>
                </a>
              </li>

              <li class="company-job-item">
                <a href="" class="job-info">
                  <div class="job-info-top">
                    <p class="name">{{ item.jobList[0].name }}</p>
                    <p class="salary">{{ item.jobList[0].salary }}</p>
                  </div>
                  <p class="job-tag">
                    <span>{{ item.jobList[0].address }}</span>
                    <span>{{ item.jobList[0].experience }}</span>
                    <span>{{ item.jobList[0].education }}</span>
                  </p>
                </a>
              </li>
            </ul>

            <a href="" class="more-job-btn">查看更多职位</a>
          </div>
        </div>
        <p class="buttom-box">
          <el-button type="primary" plain>查看更多</el-button>
        </p>
      </main>
    </div>
  </section>
</template>
<style lang="scss" scoped>
.header {
  font-size: 32px;
  font-weight: 600;
  color: #222;
  line-height: 45px;
  margin-bottom: 12px;
}

.position-item-box {
  height: 388px;
  width: 384px;
  // border-radius: 12px;
  margin: 0 16px 16px 0;
}

.position-item-box:nth-child(3n) {
  margin-right: 0;
}

.enterprise-item-box {
  background-color: #fff;
  height: 388px;
  width: 384px;
  margin: 0 16px 16px 0;
  border-radius: 12px;
  overflow: hidden;
}

.enterprise-item {
  display: block;
  height: 76px;
  padding: 16px 20px;
  overflow: hidden;
  background: linear-gradient(90deg, #f2fafa 0, #fcfbfa 100%);
}

.company-logo {
  height: 44px;
  width: 44px;
  line-height: 44px;
  overflow: hidden;
  float: left;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.company-logo img {
  max-width: 100%;
  min-height: 100%;
  display: block;
  border-radius: 4px;
}

.company-info {
  float: left;
  margin-left: 16px;
  width: 282px;
}

.company-info h3 {
  height: 22px;
  font-size: 16px;
  font-weight: 400;
  color: #222;
  line-height: 22px;
  margin: 0 0 4px 0;
  padding: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.company-info p {
  height: 18px;
  font-size: 13px;
  font-weight: 400;
  color: #999;
  line-height: 18px;
}

.company-job-list {
  display: block;
  padding: 4px 20px 12px;
  margin-right: -16px;
  overflow: hidden;
}

.company-job-item {
  display: block;
  height: auto;
  width: 344px;
  font-size: 0;
  padding: 12px 0;
  margin: 0;
  float: left;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.job-info {
  display: block;
  padding: 0;
  width: 100%;
}

.job-info-top {
  display: flex;
  width: 100%;
  align-items: center;
  margin-bottom: 12px;
}

.job-info .name {
  position: relative;
  max-width: 200px;
  line-height: 22px;
  font-size: 16px;
  font-weight: 500;
  color: #222;
  margin-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all linear 0.2s;
}

.job-info .salary {
  font-size: 16px;
  color: #fe574a;
  line-height: 22px;
  flex: 1;
  text-align: right;
  max-width: none;
  font-weight: 500;
}

.job-tag {
  font-size: 13px;
  color: #666;
  padding-right: 0;
  line-height: normal;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-tag span {
  display: inline-block;
  height: 18px;
  font-size: 13px;
  font-weight: 400;
  color: #666;
  line-height: 18px;
  padding: 2px 10px;
  border-radius: 4px;
  background: #f8f8f8;
}

.job-tag span + span {
  margin-left: 8px;
}

.more-job-btn {
  background-color: #ecf5ff;
  display: block;
  margin: 0 auto;
  width: 122px;
  height: 30px;
  line-height: 30px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #a0cfff;
  font-size: 14px;
  font-weight: 400;
  color: #409eff;
  transition: all 0.2s linear;
}

.more-job-btn:hover {
  color: #ffffff;
  background-color: #409eff;
  border-color: #409eff;
}

.buttom-box {
  text-align: center;
  margin-top: 12px;
}

.el-button {
  width: 184px;
  height: 40px;
}
</style>
